#include "SubscribeMsgDel.h"
#include "Util/NoticeCenter.h"


using namespace Fdt;


namespace Media{

SubscribeMsgDel::Ptr   SubscribeMsgDel::sm_subscribeMsgDelIns;
std::mutex 		       SubscribeMsgDel::sm_insMutex;

SubscribeMsgDel::Ptr SubscribeMsgDel::instance()
{
	if(!sm_subscribeMsgDelIns)
    {
        std::lock_guard<std::mutex> guard(sm_insMutex);
        if(!sm_subscribeMsgDelIns)
        {
            sm_subscribeMsgDelIns = std::make_shared<SubscribeMsgDel>();
        }
    }
    return sm_subscribeMsgDelIns;
}

SubscribeMsgDel::SubscribeMsgDel() 
{ 

}

SubscribeMsgDel::~SubscribeMsgDel() 
{ 
    NoticeCenter::Instance().delListener(m_listenerTag);
}


bool SubscribeMsgDel::subscribeMessages()
{
    /*m_listenerTag = this;
	std::weak_ptr<SubscribeMsgDel> weakSelf = shared_from_this();

	NoticeCenter::Instance().addListener(m_listenerTag, MediaSubscribeMsg::kMsgDeviceShutdown , [weakSelf]() {
        auto strongSelf = weakSelf.lock();
        if (!strongSelf) {
            return;
        }
        strongSelf->onDevShutdown();

	});*/


	
    return true;
}

bool SubscribeMsgDel::onDevShutdown()
{
    return true;
}


}
